package m.store.model;

import m.common.model.FieldMeta;
import m.common.model.MigrationModel;
import m.common.model.Model;
import m.common.model.TableMeta;
import m.common.model.type.FieldType;
import m.common.model.util.ModelQueryList;
import m.common.model.util.QueryCondition;

import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

@TableMeta(name="ts_pay_amount",description="付款金额")
public class PayAmount extends OrderModel implements MigrationModel {
    @Override
    public List<String> migrationOidList(String storeOid) throws Exception {
        return ModelQueryList.getModelList(this.getClass(),new String[]{"oid"},null,
                        QueryCondition.eq("store.oid",storeOid))
                .stream().map(Model::getOid).collect(Collectors.toList());
    }
    @FieldMeta(name = "remark",type = FieldType.STRING,length = 1000,description = "备注")
    private String remark;
    @FieldMeta(name="pay_amount",type= FieldType.DOUBLE,defaultValue = "0",description="付款金额")
    private Double payAmount;
    @FieldMeta(name="pay_date",type= FieldType.DATE,description="付款时间")
    private Date payDate;

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Double getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Double payAmount) {
        this.payAmount = payAmount;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }
}
